#1、下面程序的功能是：给定一下学生姓名和成绩，输出所有不及格的学生姓名和成绩，请找出错误并修改验证
"""
# 错误代码
students = [
    ['赵', 60],
    ['钱', 34],
    ['孙', 89],
    ['李', 56],
    ['周', 90],
]
# for student in students:
#     print(student)
    # if student < 60:
    #     name = student[1]
    #     score = student[2]
    #     print('姓名：',name,'\t','成绩：',score)
# 正确代码
for student in students:
    if student[1] < 60:
        name = student[0]
        score = student[1]
        print('姓名：',name,'\t','成绩：',score)
Gitee - 基于 Git 的代码托管和研发协作平台

#2、下面程序的功能是：使用字典存储多个英文单词及其译文，输入英文，输出该单词的译文，请找出错误并修改验证
"""
# 错误代码
# number = int(input('请输入将要存入字典的英文单词个数：'))
# word_explain = {}
# for i in range(number):
#     word,explain = input('请输入英文：'),input('请输入对应的译文：')
#     word_explain{word} = explain
# new_word = input('请输入要翻译的英文单词：')
# if new_word in word_explain:
#     print(new_word)
# else:
#     print('no found')
# 正确代码
number = int(input('请输入将要存入字典的英文单词个数：'))
word_explain = {}
for i in range(number):
    word,explain = input('请输入英文：'),input('请输入对应的译文：')
    word_explain[word] = explain
new_word = input('请输入要翻译的英文单词：')
if new_word in word_explain:
    print(word_explain[new_word])
else:
    print('no found')

    